//
//  MPHttpTool.h
//  AT
//
//  Created by xiao6 on 2017/11/8.
//  Copyright © 2017年 FDLive. All rights reserved.
//

#import "ATHttpTool.h"
#import "ATApiResult.h"

FOUNDATION_EXTERN NSString * const MPNoNetworkMsg; //  无网络连接，请检查网络设置


#define ATDefaultFailure  ^(NSString *errorMsg) {\
[self endRefreshFailure];\
[MBProgressHUD showMessage:errorMsg];\
}

#define ATHttpFailure  ^(NSString *errorMsg) {\
[MBProgressHUD showMessage:errorMsg];\
}

#define ATHttpFailureWithHud(hud)  ^(NSString *errorMsg) {\
[hud hideWithMessage:errorMsg completion:nil];\
}

@interface MPHttpTool : ATHttpTool

+ (NSURLSessionDataTask *)POST:(NSString *)urlString
                        params:(id)params
                       success:(void (^)(NSURLSessionDataTask *task, ATApiResult *result))success
                       failure:(void (^)(NSString *errorMsg))failure;

+ (NSURLSessionDataTask *)GET:(NSString *)urlString
                       params:(id)params
                      success:(void (^)(NSURLSessionDataTask *task, ATApiResult *result))success
                      failure:(void (^)(NSString *errorMsg))failure;
@end
